﻿#pragma once

#include "precomp.h"
#include "bullet.h"
#include "enemy.h"
#include "effect.h"
#include "renders.h"
#include "sound.h"
#include "player.h"
#include "dialog.h"
#include "global_state.h"

struct GameEvent{
	int eventtype;
	float time;

	float position_x;
	float position_y;
	float move;
	float angle;
	float base_speed;
	float speed;
	int version;
	int hp;
	int score;
	CL_String path;
	CL_String render;
	float collision;
	int bonus;
	int shots;
	int have_dialog;
	_BulletPattern bullet_patterns[64];

	CL_String string_param;
	CL_String string_param_other;
	float float_param;

	bool operator < (GameEvent &ge1);
};

class GameTimer{
public:
	GameTimer();
	~GameTimer();

	void Load(CL_ResourceManager &resources, CL_String name);
	void Process(float time);

	float leveltime;
	unsigned int currentevent;
	bool paused;
	float pause_time;
	std::vector<GameEvent> gameevents;
	std::map<std::string, std::vector<_SpellPattern>> spell_patterns; // Отдельное хранилище для спеллкарт боссов
};

extern GameTimer game_timer;
